﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace JzSport.Model
{
    public class ServiceResult<T>
    {
        public int ErrorCode { get; set; }
        public T Data { get; set; }

        public Exception ErrorException { get; set; }

        public ServiceResult(int errorCode)
        {
            ErrorCode = errorCode;
        }

        public ServiceResult(int errorCode, T data)
        {
            ErrorCode = errorCode;
            Data = data;
        }

        public ServiceResult(int errorCode, T data, Exception exception)
        {
            ErrorCode = errorCode;
            Data = data;
            ErrorException = exception;
        }
    }

    public class PagedList<T>
    {
        public int Start { get; set; }
        public int Limit { get; set; }
        public int Total { get; set; }
        public List<T> Items { get; set; }

        public PagedList()
        {
            Items = new List<T>();
        }
    }
}
